Event.observe(window, 'load', canvasOptionForm, false);
Event.observe(window, 'unload', Event.unloadCache, false);

function canvasOptionForm() {
	Event.observe('save_options', 'click', optionsUpdate, false);
}

function optionsUpdate() {
	$('save_button').style.backgroundImage = "url('../wp-content/plugins/Canvas/images/spinner.gif')";
	var pars = Form.serialize('options');
	$$('form#options label input').each(function(item){
		if($(item).checked == false) pars = pars+item.id+'=0&';
	});
	pars = pars.substr(0,pars.length-1);
    var url = '../wp-content/plugins/Canvas/ajax/canvas-save-option.php';
    var myAjax = new Ajax.Request(url, 
        {method: 'post',
        parameters: pars,
        onComplete: function(){ $('save_button').style.backgroundImage = "url('')"; }
        });
}